import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/team/list',
    method: 'get',
    params: query
  })
}

export function fetchAllTeams(query) {
  return request({
    url: '/api/team/list-all',
    method: 'get',
    params: query
  })
}

export function fetchTeam(id) {
  return request({
    url: '/api/team/detail',
    method: 'get',
    params: { id }
  })
}

export function createTeam(data) {
  return request({
    url: '/api/team/create',
    method: 'post',
    data
  })
}

export function updateTeam(data) {
  return request({
    url: '/api/team/update',
    method: 'post',
    data
  })
}

export function deleteTeam(teamId) {
  return request({
    url: '/api/team/delete/' + teamId,
    method: 'post'
  })
}
